<?php

use think\migration\Migrator;
use think\migration\db\Column;

class CmRole extends Migrator
{

    public function change()
    {
        $table = $this->table('cm_role', ['auto_increment' => true, 'limit' => 10, 'signed' => false]);
        $table->addColumn('name', 'string', ['limit' => 255, 'default' => '', 'comment' => '角色名称'])
            ->addColumn('create_way', 'integer', ['limit' => 255, 'default' => 0, 'signed' => false, 'comment' => '创建路径 0：系统预定义 1：手动添加'])
            ->addColumn('create_from_id', 'integer', ['limit' => 10, 'default' => 0, 'signed' => false, 'comment' => '来源的角色Id'])
            ->addColumn('is_system', 'integer', ['limit' => 255, 'default' => 0, 'signed' => false, 'comment' => '是否系统 0：否 1：是'])
            ->addColumn('rights', 'text', ['comment' => '权限 （权限Id值，多个用\', \'隔开）'])
            ->addColumn('describe', 'string', ['limit' => 150, 'default' => '', 'comment' => '说明'])
            ->create();
    }
}
